#include "RobotPart.h"


RobotPart::RobotPart(void)
{
	elevation = 0;
	angle = 0;
}

void RobotPart::display(){}
void RobotPart::switchTexture(){}
int RobotPart::getUpgradeLife(){return 0;}
int RobotPart::getUpgradePower(){return 0;}
GLuint RobotPart::getTexture(){return 0;}
void RobotPart::drawCube(GLfloat one, GLfloat two, GLfloat three, GLfloat four)
{
	glTranslatef(-0.5, -0.5, -0.5);
	glBegin(GL_QUADS);
		// top
		glNormal3f(0,1,0);
		glTexCoord2f(0.0f, 0.0f); glVertex3f(0.0f, 1.0f, 0.0f);
		glTexCoord2f(0.0f, one); glVertex3f(0.0f, 1.0f, 1.0f);
		glTexCoord2f(three, one); glVertex3f(1.0f, 1.0f, 1.0f);
		glTexCoord2f(three, 0.0f); glVertex3f(1.0f, 1.0f, 0.0f);
		// front
		glNormal3f(0,0,1);
		glTexCoord2f(0.0f, two); glVertex3f(0.0f, 1.0f, 1.0f);
		glTexCoord2f(0.0f, one); glVertex3f(0.0f, 0.0f, 1.0f);
		glTexCoord2f(three, one); glVertex3f(1.0f, 0.0f, 1.0f);
		glTexCoord2f(three, two); glVertex3f(1.0f, 1.0f, 1.0f);
		// bottom
		glNormal3f(0,-1,0);
		glTexCoord2f(0.0f, 0.0f); glVertex3f(0.0f, 0.0f, 0.0f);
		glTexCoord2f(three, 0.0f); glVertex3f(1.0f, 0.0f, 0.0f);
		glTexCoord2f(three, one); glVertex3f(1.0f, 0.0f, 1.0f);
		glTexCoord2f(0.0f, one); glVertex3f(0.0f, 0.0f, 1.0f);		
		// back
		glNormal3f(0,0,-1);
		glTexCoord2f(0.0f, one); glVertex3f(0.0f, 0.0f, 0.0f);
		glTexCoord2f(0.0f, two); glVertex3f(0.0f, 1.0f, 0.0f);
		glTexCoord2f(three, two); glVertex3f(1.0f, 1.0f, 0.0f);
		glTexCoord2f(three, one); glVertex3f(1.0f, 0.0f, 0.0f);
		// right
		glNormal3f(1,0,0);
		glTexCoord2f(four, 0.0f); glVertex3f(1.0f, 1.0f, 1.0f);
		glTexCoord2f(three, 0.0f); glVertex3f(1.0f, 0.0f, 1.0f);
		glTexCoord2f(three, one); glVertex3f(1.0f, 0.0f, 0.0f);
		glTexCoord2f(four, one); glVertex3f(1.0f, 1.0f, 0.0f);
		//left
		glNormal3f(-1,0,0);
		glTexCoord2f(four, 0.0f); glVertex3f(0.0f, 0.0f, 0.0f);
		glTexCoord2f(four, one); glVertex3f(0.0f, 0.0f, 1.0f);
		glTexCoord2f(three, one); glVertex3f(0.0f, 1.0f, 1.0f);
		glTexCoord2f(three, 0.0f); glVertex3f(0.0f, 1.0f, 0.0f);
	glEnd();
}

void RobotPart::animate(){}
void RobotPart::reset(){}
void RobotPart::setAngle(GLfloat a)
{
	angle = a;
}
void RobotPart::setElevation(GLfloat h)
{
	elevation += h;
}
GLfloat RobotPart::getElevation()
{
	return elevation;
}

RobotPart::~RobotPart(void)
{
}
